import { IMessagePreview } from '@/views/home/chat/types';
import { defineStore } from 'pinia';
import folder from '@/assets/images/folder.png';
import subscribe from '@/assets/images/subscribe.png';
import { nanoid } from 'nanoid';
import { avatarApi, multiavatar } from '@/api/common';

interface MessageList {
  list: IMessagePreview[];
}
const useMessageStore = defineStore('message', {
  state: (): MessageList => {
    return {
      list: [
        {
          title: '订阅号消息',
          time: '12.30',
          unread: false,
          lastMessage: '[2条]腾讯旗下公司正在扩张',
          avatar: subscribe,
          type: 'system',
          sort: 1,
          disturb: false,
          topping: false,
          id: '1',
          show: true,
          messageList: [],
        },
        {
          title: '文件传输助手',
          time: '12.30',
          unread: false,
          lastMessage: '',
          avatar: folder,
          type: 'system',
          sort: 2,
          disturb: false,
          topping: true,
          id: '2',
          show: true,
          messageList: [],
        },
      ],
    };
  },
  persist: true,
});

export default useMessageStore;
